﻿using System;
using BSDS.Core.Infrastructure.Logging;
using BSDS.Service.Configuration;

namespace BSDS.Service.Utils
{
    public class FileWatcherFactory
    {
        private readonly TimeSpan maxFileCopyTime;
        private readonly Logger logger;

        public FileWatcherFactory(TimeSpan maxFileCopyTime, Logger logger)
        {
            this.maxFileCopyTime = maxFileCopyTime;
            this.logger = logger;
        }

        public FileSystemWatcherAdapter Create(string directoryPath)
        {
            return new FileSystemWatcherAdapter(directoryPath, maxFileCopyTime, logger);
        }
    }
}